import { cateList } from '../../../request/api';
const state = {
    catelist: [],//商品分类列表
}

const mutations = {
    CATELIST(state,payload){
        state.catelist = payload
    }
}

const actions = {
    getCatelistAction({ commit }) {
        cateList({
            istree:1
        }).then(res => {
            // console.log(res);
            commit('CATELIST',res.list)

        })
    }
}

const getters = {
    getCateList(state) {
        return state.catelist
    }
}

export default {
    state, mutations, actions, getters, namespaced: true
}